package InterfaceOffer;

import java.util.Scanner;

public class TencentSolution2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        //n代表用户数量，k代表要发的广告数量
        int n = in.nextInt();
        int k = in.nextInt();
        //然后依次输入用户的起始时间
        int startTime[] = new int[n];
        int currentTime[] = new int[n];
        for (int i = 0; i < n; i++) {
            startTime[i] = in.nextInt();
            currentTime[i] = startTime[i];
        }
        //计算轮数
        int tern = k / n + 1;
        //每次比较n个用户的起始时间，输出较小的那个
        for (int i = 0; i < k; i++) {
            System.out.println(selectMin(startTime,currentTime));
        }

    }

    public static int selectMin(int[] startTime, int[] currentTime) {
        int min = currentTime[0];
        int index = 0;
        for (int i = 1; i < currentTime.length; i++) {
            if (currentTime[i] < min) {
                min = currentTime[i];
                index = i;
            }
        }
        // 寻找到了最小值min及其对应的用户index
        // 然后更新当前时间
        // 计算倍数
        currentTime[index] = (currentTime[index]/startTime[index]+1)*startTime[index];
        return index+1;
    }

}
